home *** CD-ROM | disk | FTP | other *** search
/ Aminet 31 / Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso / Aminet / dev / gui / gui4cli.lha / Gui4Cli / Dir / dir.vsg < prev    next >
Text File  |  1999-04-21  |  3KB  |  141 lines

  1. G4C 
  2.  
  3. ; this is a GUI for Visage
  4.  
  5.  
  6. WINBIG 404 34 74 66 "Visage"
  7. wintype  11110001          ; a resizable window
  8. ; winbackground icon guis:info/bgnds/tile 0
  9. varpath dir.gc
  10.  
  11. ;============================> Some Graphics (to fill in space)
  12.  
  13. BOX 0 0 159 115 out button
  14.  
  15. ;============================> on loading
  16.  
  17. xONLOAD ; Set the default values of our vars
  18.    ; defaults
  19.    res     = "" ; resolution 
  20.    lace    = "" ; interlace
  21.    dtype   = "" ; datatypes
  22.    time    = 0  ; show pics for ever
  23.    setgad #this 10 off
  24.    guiopen #this
  25.  
  26. xonclose
  27. guiquit #this
  28.  
  29. xonfail
  30. guiquit #this
  31.  
  32. ;===================> A cycler for the Resolution Modes
  33.  
  34. XCYCLER 2 2 70 14 Res. res
  35. CSTR  Def  ''
  36. CSTR  Low      'Low Res'
  37. CSTR  High     'High Res'
  38. CSTR  "S-Hi" 'Super-High Res'
  39. if $res > ''
  40.    setgad #this 10 on
  41. else
  42.    setgad #this 10 off
  43. endif
  44.  
  45. XCHECKBOX 46 17 26 11 Lace lace Laced '' OFF
  46. gadid 10
  47.  
  48. XCHECKBOX 46 28 26 11 DT dtype DATATYPES "" OFF
  49. gadid 11
  50.  
  51. XHSLIDER 4 40 43 12 '' time 0 60 0 "%lds"
  52. GadID 12
  53.  
  54. ; ----------------------------------------------------------
  55. ;       play selection
  56. ; ----------------------------------------------------------
  57.  
  58. XBUTTON 3 53 69 12 PLAY
  59.    id  = $$LV.ID ; get the listview's id
  60.    dir = $$LV.DIR
  61.    vsg_end = 0
  62.    lvuse dir.gc $id
  63.    lvmulti first ; get first file
  64.    if $lv_file = ""
  65.       ezreq "How's about choosing\nsome files first ?" 'Oh yeah..' ""
  66.       stop
  67.    endif
  68.  
  69.    cd $dir ; cd to the current directory
  70.  
  71.    ; construct line & launch it
  72.    gosub #this getfiles
  73.    gosub #this makecom
  74.    launch 1 'sys:utilities/visage >nil: $files $com'
  75.    ; say 'sys:utilities/visage >nil: $files $com\n'
  76.  
  77. xOnReturn 1
  78.    if $vsg_end = 1         ; if no more files, we're done..
  79.       stop
  80.    endif
  81.    lvuse dir.gc $id        ; it may have been changed..
  82.    cd $$lv.dir
  83.    lvmulti next
  84.    if $lv_file > ""
  85.       gosub #this getfiles
  86.       gosub #this makecom
  87.       launch 1 'sys:utilities/visage >nil: $files $com'
  88.    endif
  89.  
  90.  
  91. ; ----------------------------------------------------------
  92. ;       routine to collect files (only names since we cd)
  93. ; ----------------------------------------------------------
  94.  
  95. xRoutine getfiles
  96.    local counter
  97.    counter = 0          ; counter - max = 900/30=30 files
  98.    files = ""           ; this were we'll put the files
  99.  
  100.    while $counter < 30
  101.    and $$lv.line > ''
  102.         extract lv_file ext ext
  103.         if $ext == .info
  104.            ;
  105.         else
  106.            extract lv_file file file
  107.            appvar files ' $file'
  108.            ++counter
  109.            ; lvmulti off
  110.         endif
  111.         lvmulti next
  112.    endwhile
  113.    if $$lv.line = ''
  114.       vsg_end = 1       ; flag end of files
  115.    endif
  116.  
  117. ; ----------------------------------------------------------
  118. ;       countrust rest of command line
  119. ; ----------------------------------------------------------
  120.  
  121. xRoutine makecom
  122.    com = ''
  123.    if $res > ''
  124.       com = 'mode=\"PAL:$res'
  125.       if $lace > ''
  126.          appvar com ' $lace'
  127.       endif
  128.       appvar com '"'
  129.    endif
  130.  
  131.    if $dtype > ''
  132.       appvar com ' DATATYPES'
  133.    endif
  134.  
  135.    if $time > 0
  136.       appvar com ' DELAY=$time'
  137.    endif
  138.  
  139.    appvar com ' CENTER BB=ON'
  140.  
  141.